#ifndef _COMMON_H_
#define _COMMON_H_

#include "LibBase.h"
#define MAX_SENDER_THREAD 100
#define MAX_WINDOW_SIZE 16
#define MAX_PACKET_SIZE 1472

#define FLAG_ACK 1
#define FLAG_RECVREPORT 2
#define FLAG_STATUS 3
#define FLAG_SENDREPORT 4
#define FLAG_DATA 5

#define MAX_SEQ_SIZE 128

#define MAX_SEED_VELO 4000000
#define SEQ_RE_SEND  0
#define SEQ_IS_RECVD 1

#define SERVER_WAIT_TIME 3000
typedef struct 
{
	unsigned int iSize;
	unsigned char *ucData;
	
}sPacket;

typedef struct 
{
  
  	
  char cClientIP[100];
  char cClientPort[100];
  int iWindowSize;
  int iCurrentSeq;
  unsigned char  SeqRecved[MAX_SEQ_SIZE];
  sPacket SendPacket[MAX_WINDOW_SIZE];
  LONGLONG llSendbytes;
  
}SendChannel;

typedef struct 
{
  
  unsigned char ucIsUsed;		
  char cServerIP[100];
  char cServerPort[100];
  LONGLONG  llRecvBytes;
 


	
  int iWindowSize;
  int iCurrentSeq; 
  unsigned char RP[MAX_WINDOW_SIZE];
  sPacket Packet[MAX_WINDOW_SIZE];
  
}RecvChannel;


typedef struct 
{
	char flag;
	char index;
	char seq;
	unsigned long timestamp;

	
}PacketHead;

typedef struct 
{
	char flag;
	unsigned long speed;
	unsigned long interval;//ms
	

}SenderReport;

typedef struct 
{
	char flag;
	unsigned char seq;
	unsigned int velo;
	unsigned char PacketRec[MAX_WINDOW_SIZE];
}RecverReport;




#endif